package admin

import (
	"gin-canteen-src/global"
	"time"
)

// 用户模型
type User struct {
	global.GloModel
	Username string     `json:"username" gorm:"comment:用户登录名" comment:"用户登录名"`
	Password string     `json:"password"  gorm:"comment:用户登录密码" comment:"用户登录密码"`
	Salt     string     `json:"salt" gorm:"comment:盐" comment:"盐"`
	Sort     int64      `json:"sort" gorm:"comment:排序" comment:"排序"`
	RoleId   int64      `json:"role_id" gorm:"comment:角色ID" comment:"角色ID"`
	IsActive uint8      `json:"is_active" gorm:"comment:是否激活" comment:"是否激活"`
	IsSuper  uint8      `json:"is_super" gorm:"comment:是否超管" comment:"是否超管"`
	LoginAt  *time.Time `json:"login_time" gorm:"comment:登录时间" comment:"登录时间"`
}

func (User) TableName() string {
	return "user"
}
